1. Field of the Invention
The present invention relates to a method of operating a finite state machine, a computer apparatus for operating a finite state machine, and a non-transitory computer-readable storage medium.
2. Description of the Related Technology
A finite state machine is operated on a computer apparatus and can be regarded as a process that can be in one of a finite number of states at any particular time, that state typically being called the current state. The finite state machine can transition to another state and/or cause an action or output to take place when initiated by a triggering event. The state to which the finite state machine moves (the “next state”) or the action/output that takes place depends on the current state of the machine and the event that triggered the transition. Thus, the finite state machine design technique allows input stimuli to be handled differently based on the (current) state of a device. A particular finite state machine is defined by a set of the possible states it can transition to from each state, and the triggering condition for each transition. In general, a finite state machine can be implemented in hardware or software or a combination of the two.
Finite state machines are used in many applications and fields, including by way of example only communication protocol design, parsing and other engineering applications, in biology and artificial intelligence research, and in linguistics to describe the grammars of natural languages. The use of finite state machines in telecommunications software in particular is universal, as a telecommunications system needs to react differently to a given input stimulus depending on past events (i.e. typically, its current state).
A simple example of use of a finite state machine in a telecommunications scenario would be to consider what happens when a land-line telephone goes “off hook” (i.e. the handset is lifted). The system that controls the telephone behaves differently depending on whether the telephone is ringing or not. If the telephone is ringing, the off-hook input stimulus causes ringing to stop, a voice path to be established with the calling party and a billing cycle to begin (because an incoming call is being received). If the telephone is not already ringing, a dial tone is played and digit collection begins (because the user has lifted the handset to initiate a call). Thus, the same event (in this simple example, lifting the handset) results in a different action being taken depending on the current state of the device (here, whether the telephone is ringing or not). A finite state machine is typically used to provide this behavior. Finite state machines are used in many other, typically (much) more complex, situations.
As telecommunications systems have evolved, state machines have become increasingly complex. As a particular example, mobile networks have a concept of “presence” (is the phone on) and “location” (where is the phone) which can drive certain finite state machines to behave differently. More possible states and an ever evolving set of input stimulus have added to this complexity. Increasingly, service providers are trying to leverage services that were built on one network technology by applying them to users in so-called next generation networks. This activity involves deriving complex finite state machines to handle interaction between different networks that each have their own set of states and input stimulus.
In most implementations, finite state machines are statically defined using a “jump table”. In the simplest case, conceptually a 2 dimensional array is organized such that input stimulus or event and current state are mapped to a particular function. Once the function is performed, the state may change in preparation for the next event. In a finite state machine implemented in software, these jump tables are conventionally usually compiled into the binary source code and cannot be changed without rebuilding and reinstalling the computer program. However, this is very limiting, since each application is different, requiring a different set of states, inputs, and functions, and prevents or hinders easy, rapid development of complex and evolving software systems.